using System;

using SdlDotNet.Graphics;

using Game.Data;
using Game.Input.GUI;
using Game.World;

namespace Game.Output
{
	public static class CScreen
	{
		private const int SCREEN_WIDTH	= 640;
		private const int SCREEN_HEIGHT	= 480;
		
		private static Surface m_surface;
		
		private static CWorld			m_world;
		private static CCountry[]		m_countries;
		private static CTileIndicator	m_tileIndicator;
		
		public static void Initialize()
		{
			m_surface = Video.SetVideoMode(
				SCREEN_WIDTH, SCREEN_HEIGHT, 32, false, false, false, true);
			
			Video.WindowCaption = CData.Texts.Get("GAME_TITLE");
			Video.WindowIcon();
			
			InitializeSubSystems();
		}
		
		private static void InitializeSubSystems()
		{
			CMainMenu.Initialize();
			CCursor.Initialize();
			
			m_world = new CWorld("firstworld");
			
			m_countries = new CCountry[1];
			m_countries[0] = new CCountry("germany", m_world);
			
			m_tileIndicator = new CTileIndicator(m_countries[0]);
		}
		
		public static void Render()
		{
			CMainMenu.Render(ref m_surface);
			
			CCursor.Render(ref m_surface);
			
			m_tileIndicator.Render(ref m_surface);
		}
		
		#region properties
		
		public static Surface Surface
		{
			get {
				return m_surface;
			}
		}
		
		#endregion
		
	}
}
